﻿#pragma once

#include "../MonsterObject.h"
#include "../../MirDatabase/MonsterInfo.h"
#include "../../../Shared/Enums.h"
#include "../PlayerObject.h"
#include "../../../Shared/Packet.h"

using namespace Server::MirDatabase;
using namespace Server::MirEnvir;
namespace S = ServerPackets;

namespace Server::MirObjects::Monsters
{
    class BlockingObject : public MonsterObject
    {
    public:
        MonsterObject *Parent;
        bool Visible = false;

        virtual ~BlockingObject()
        {
            delete Parent;
        }

    protected:
        BlockingObject(MonsterObject *parent, MonsterInfo *info);

    public:
        bool getBlocking() const override;

        bool Walk(MirDirection dir) override;

        bool IsAttackTarget(MonsterObject *attacker) override;
        bool IsAttackTarget(PlayerObject *attacker) override;

    protected:
        void ProcessRoam() override;

        void ProcessSearch() override;

    public:
        int Attacked(PlayerObject *attacker, int damage, DefenceType type = DefenceType::ACAgility, bool damageWeapon = true) override;

        void Spawned() override;

        Packet *GetInfo() override;

        void Hide();

        void Show();
    };
}
